#ifndef _GAME_FUNCTION_H
#define _GAME_FUNCTION_H

struct data {
    char name[20];
    char passwd[20];
    int  grade;
    int  gold;
    struct data *next;
};

struct core {
    struct data *data;
    char *pattern[3];
};

enum main_menu {
    LOGIN = 0,
    RANK,
    SIGN_IN,
    EXIT
};

enum game_menu {
    START_GAME = 0,
    BUY_GOLD,
    BACK
};

extern struct core   *init();
extern int    run(struct core *);
extern void   destory(struct core *);

extern int    input_gold(int);
extern int    purchase_gold(struct data *);
extern char  *pattern_one(void);
extern char  *pattern_two(void);
extern char  *pattern_three(void);
extern int    game_choice(void);
extern void   game_show(void);
extern void   change_gold_grade(int, int);
extern void   cover(void);
extern void   rank(struct data *);
extern int    game(struct core *, char *);
extern int    game_start(struct core *, struct data *);
extern int    judge_number(int);
extern struct data *find_name(char *, struct data *);

#endif
